{
   Компоненты схем

 TSchemeElmnt

  версия 0.1 декабрь 2010 prodg@ya.ru D.Kondakov
}
unit VislScheme;

{$mode objfpc}{$H+}

interface

uses
  Classes, SysUtils, IntfGraphics;

type
  TSchemeID = integer;
  TSchemeName = string;
  TSchemeText = string;
  TSchemeCoord = real;
  TSchemeLength = real;
  TSchemeAgle = real;
  TSchemeAlign = real;
  TSchemePoint = record
    sX: TSchemeCoord;
    sY: TSchemeCoord;
  end;

  TSchemeBounds = record

  end;

  TSchemeImage = class(TLazIntfImage)

  end;

  { TSchemeElmnt }

  TSchemeElmnt = class
  private
    seData: pointer;
  protected
    function GetStringBegin: TSchemeText; virtual;
    function GetStringEnd: TSchemeText; virtual;
    function GetStringInfo: TSchemeText; virtual;
    function GetSizeBegin: integer; virtual;
    function GetSizeEnd: integer; virtual;
    function GetSizeInfo: integer; virtual;
    procedure GetDataBegin(var data: pointer); virtual;
    procedure GetDataEnd(var data: pointer); virtual;
    procedure GetDataInfo(var data: pointer); virtual;
    function GetSchElmntPicture: TSchemeImage; virtual; abstract;
    function GetSchElmntThumbnail: TSchemeImage; virtual; abstract;
    function GetSchElmntOverall: TSchemeImage; virtual; abstract;
  public
    property sPic: TSchemeImage read GetSchElmntPicture;
    property sThmb: TSchemeImage read GetSchElmntThumbnail;
    property sOvrl: TSchemeImage read GetSchElmntOverall;
    constructor Create;
    destructor Destroy; override;
    procedure SaveData(strm: TStream); virtual;
    procedure LoadData(strm: TStream); virtual;
  end;

  { TSchemeTool }

  TSchemeTool = class
  private
    stName: TSchemeName;
  public
    property tName: TSchemeName read stName;
    constructor Create(N: TSchemeName);
    destructor Destroy; override;

  end;

  { TGroupSchemeElmnt }

  TGroupSchemeElmnt = class(TSchemeElmnt)
    sgItems: array of TSchemeElmnt;
    sgPostns: array of TSchemePoint;
    sgAngles: array of TSchemeAgle;
  public
    constructor Create;
    destructor Destroy; override;
  end;

  { TPointSchemeElmnt }

  TPointSchemeElmnt = class(TSchemeElmnt)
  private
    sePic: TSchemeImage;
  protected
    function GetStringBegin: TSchemeText; override;
    function GetStringEnd: TSchemeText; override;
    function GetStringInfo: TSchemeText; override;
    function GetSizeBegin: integer; override;
    function GetSizeEnd: integer; override;
    function GetSizeInfo: integer; override;
    procedure GetDataBegin(var data: pointer); override;
    procedure GetDataEnd(var data: pointer); override;
    procedure GetDataInfo(var data: pointer); override;
  public
    constructor Create;
  end;

  { TLineSchemeElmnt }

  TLineSchemeElmnt = class(TSchemeElmnt)
  private
    slDepth: TSchemeLength;
    slLength: TSchemeLength;
    function GetSchElmntDepth: TSchemeLength;
    function GetSchElmntLength: TSchemeLength;
  public
    property sD: TSchemeLength read GetSchElmntDepth;
    property sL: TSchemeLength read GetSchElmntLength;
    constructor Create;
    destructor Destroy; override;
  end;

  { TRectSchemeElmnt }

  TRectSchemeElmnt = class(TSchemeElmnt)
  private
    seOffx: TSchemeCoord;
    seWidth: TSchemeCoord;
    seHeight: TSchemeCoord;
    function GetSchElmntOffset: TSchemePoint; virtual;
    function GetSchElmntWidth: TSchemeCoord; virtual;
    function GetSchElmntHeight: TSchemeCoord; virtual;
  public
    property sW: TSchemeCoord read GetSchElmntWidth;
    property sH: TSchemeCoord read GetSchElmntHeight;
    property sO: TSchemePoint read GetSchElmntOffset;
    constructor Create;
    destructor Destroy; override;
  end;

  TRowSchemeElmnt = class(TLineSchemeElmnt)

  end;

  TGridSchemeElmnt = class(TRectSchemeElmnt)

  end;

  { TCellSchemeElmnt }

  TCellSchemeElmnt = class(TRectSchemeElmnt)
    scItem: TSchemeElmnt;
    scAlignVer: TSchemeAlign;
    scAlignHor: TSchemeAlign;
    seIndent: TSchemeLength;
    constructor Create;
    destructor Destroy; override;
  end;

{  TGroupSchemeElmnt = class(TCellSchemeElmnt)
    sgItems: array of TCellSchemeElmnt
  end;

  TClocSchemeElmnt = class(TGroupSchemeElmnt)

  end;}

  { TSchemeBase }

  TSchemeBase = class

    constructor Create;
    destructor Destroy; override;
    function AddElement(Elmnt: TSchemeElmnt): TSchemeID;
    procedure DelElement(elID: TSchemeID);
    function FindElement(Elmnt: TSchemeElmnt): TSchemeID;
    function PointIn(Pnt: TSchemePoint): TSchemeID;
  end;

  { TSchemePalette }

  TSchemePalette = class
    pItems: array of TSchemeTool;
  public
    constructor Create;
    destructor Destroy; override;

  end;

implementation

{ TSchemePalette }

constructor TSchemePalette.Create;
begin

end;

destructor TSchemePalette.Destroy;
begin
  inherited Destroy;
end;

{ TSchemeBase }

constructor TSchemeBase.Create;
begin

end;

destructor TSchemeBase.Destroy;
begin
  inherited Destroy;
end;

function TSchemeBase.AddElement(Elmnt: TSchemeElmnt): TSchemeID;
begin

end;

procedure TSchemeBase.DelElement(elID: TSchemeID);
begin

end;

function TSchemeBase.FindElement(Elmnt: TSchemeElmnt): TSchemeID;
begin

end;

function TSchemeBase.PointIn(Pnt: TSchemePoint): TSchemeID;
begin

end;

{ TCellSchemeElmnt }

constructor TCellSchemeElmnt.Create;
begin

end;

destructor TCellSchemeElmnt.Destroy;
begin
  inherited Destroy;
end;

{ TRectSchemeElmnt }

function TRectSchemeElmnt.GetSchElmntOffset: TSchemePoint;
begin

end;

function TRectSchemeElmnt.GetSchElmntWidth: TSchemeCoord;
begin

end;

function TRectSchemeElmnt.GetSchElmntHeight: TSchemeCoord;
begin

end;

constructor TRectSchemeElmnt.Create;
begin

end;

destructor TRectSchemeElmnt.Destroy;
begin
  inherited Destroy;
end;

{ TLineSchemeElmnt }

function TLineSchemeElmnt.GetSchElmntDepth: TSchemeLength;
begin

end;

function TLineSchemeElmnt.GetSchElmntLength: TSchemeLength;
begin

end;

constructor TLineSchemeElmnt.Create;
begin

end;

destructor TLineSchemeElmnt.Destroy;
begin
  inherited Destroy;
end;

{ TPointSchemeElmnt }

function TPointSchemeElmnt.GetStringBegin: TSchemeText;
begin
  Result := inherited GetStringBegin;
end;

function TPointSchemeElmnt.GetStringEnd: TSchemeText;
begin
  Result := inherited GetStringEnd;
end;

function TPointSchemeElmnt.GetStringInfo: TSchemeText;
begin
  Result := inherited GetStringInfo;
end;

function TPointSchemeElmnt.GetSizeBegin: integer;
begin
  Result := inherited GetSizeBegin;
end;

function TPointSchemeElmnt.GetSizeEnd: integer;
begin
  Result := inherited GetSizeEnd;
end;

function TPointSchemeElmnt.GetSizeInfo: integer;
begin
  Result := inherited GetSizeInfo;
end;

procedure TPointSchemeElmnt.GetDataBegin(var data: pointer);
begin
  inherited GetDataBegin(data);
end;

procedure TPointSchemeElmnt.GetDataEnd(var data: pointer);
begin
  inherited GetDataEnd(data);
end;

procedure TPointSchemeElmnt.GetDataInfo(var data: pointer);
begin
  inherited GetDataInfo(data);
end;

constructor TPointSchemeElmnt.Create;
begin

end;

{ TGroupSchemeElmnt }

constructor TGroupSchemeElmnt.Create;
begin

end;

destructor TGroupSchemeElmnt.Destroy;
begin
  inherited Destroy;
end;

{ TSchemeTool }

constructor TSchemeTool.Create(N: TSchemeName);
begin

end;

destructor TSchemeTool.Destroy;
begin
  inherited Destroy;
end;

{ TSchemeElmnt }

function TSchemeElmnt.GetStringBegin: TSchemeText;
begin

end;

function TSchemeElmnt.GetStringEnd: TSchemeText;
begin

end;

function TSchemeElmnt.GetStringInfo: TSchemeText;
begin

end;

function TSchemeElmnt.GetSizeBegin: integer;
begin

end;

function TSchemeElmnt.GetSizeEnd: integer;
begin

end;

function TSchemeElmnt.GetSizeInfo: integer;
begin

end;

procedure TSchemeElmnt.GetDataBegin(var data: pointer);
begin

end;

procedure TSchemeElmnt.GetDataEnd(var data: pointer);
begin

end;

procedure TSchemeElmnt.GetDataInfo(var data: pointer);
begin

end;

constructor TSchemeElmnt.Create;
begin

end;

destructor TSchemeElmnt.Destroy;
begin
  inherited Destroy;
end;

procedure TSchemeElmnt.SaveData(strm: TStream);
begin

end;

procedure TSchemeElmnt.LoadData(strm: TStream);
begin

end;

end.

